************************************************
*Do-File for "Responding to Catastrophe"
*Reed M. Wood and Thorin M. Wright
*Journal of Conflict Resolution
*June 2015
************************************************


*set working directory to wherever the data file is located
*cd ""
clear matrix
clear
*open dataset
use "WoodWright_MainAnalysis_June242015.dta"

*Table 1

oprobit SDnew c.lnaffected disaid_GDP polity_r lnpop2 lnrgdp c.anti lndurable civcon coldwar SD1 SD2 SD3 SD4, cl(ccode)

oprobit SDnew c.lnaffected disaid_GDP polity_r lnpop2 lnrgdp c.anti lndurable civcon coldwar SD1 SD2 SD3 SD4 if occ>0 & occ!=., cl(ccode)

oprobit SDnew c.lnaffected c.disaid_GDP c.polity_r#c.disaid_GDP c.polity_r lnpop2 lnrgdp c.anti lndurable civcon coldwar  SD1 SD2 SD3 SD4 if occ>0 & occ!=., cl(ccode)

oprobit SDnew c.lnaffected c.disaid_GDP c.lnaffected#c.disaid_GDP lnpop2 lnrgdp c.anti lndurable civcon coldwar  SD1 SD2 SD3 SD4 if polity_r>=16 & polity_r!=. & occ!=., cl(ccode)

oprobit SDnew c.lnaffected c.disaid_GDP c.lnaffected#c.disaid_GDP lnpop2 lnrgdp c.anti lndurable civcon coldwar  SD1 SD2 SD3 SD4 if polity_r<=15 & polity_r!=. &  occ!=., cl(ccode)




*Figure 1


oprobit SDnew c.lnaffected disaid_GDP polity_r lnpop2 lnrgdp c.anti lndurable civcon coldwar SD1 SD2 SD3 SD4, cl(ccode)

quietly margins, at (lnaffected =(0.00(1)19) civcon=0 coldwar=0 SD1==0 SD2==1 SD3==0 SD4==0) atmeans noatlegen predict(outcome(3))

marginsplot


*Figure 2

oprobit SDnew c.lnaffected c.disaid_GDP c.polity_r#c.disaid_GDP c.polity_r lnpop2 lnrgdp c.anti  lndurable civcon coldwar  SD1 SD2 SD3 SD4 if occ>0 & occ!=., cl(ccode)

quietly margins, dydx(c.polity_r) at (disaid_GDP=(0.00(0.5)5) civcon=0 coldwar=0 SD1==0 SD2==01 SD3==0 SD4==0) atmeans noatlegen predict(outcome(3))

marginsplot


*Figure 3

*Left panel

oprobit SDnew c.lnaffected c.disaid_GDP c.lnaffected#c.disaid_GDP lnpop2 lnrgdp anti lndurable civcon coldwar  SD1 SD2 SD3 SD4 if polity_r>=16 & polity_r!=. & occ!=., cl(ccode)

quietly margins, dydx(disaid_GDP) at(lnaffected =(0.00(1)19) civcon=0 coldwar=0 SD1==0 SD2==1 SD3==0 SD4==0) atmeans noatlegen predict(outcome(3))

marginsplot


*Right Panel

oprobit SDnew c.lnaffected c.disaid_GDP c.lnaffected#c.disaid_GDP lnpop2 lnrgdp anti lndurable civcon coldwar  SD1 SD2 SD3 SD4 if polity_r<=15 & polity_r!=. &  occ!=., cl(ccode)

quietly margins, dydx(disaid_GDP) at(lnaffected =(0.00(1)19) civcon=0 coldwar=0 SD1==0 SD2==1 SD3==0 SD4==0) atmeans noatlegen predict(outcome(3))

marginsplot
